
package com.jf.cloud.product.controller.app;

import com.jf.cloud.common.response.ServerResponseEntity;
import com.jf.cloud.product.service.SpuTagService;
import com.jf.cloud.product.vo.SpuTagVO;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 商品分组表
 *
 * @author zz
 * @date 2021-02-20 14:28:10
 */
@RestController("appSpuTagController")
@RequestMapping("/ua/spu_tag")
@Tag(name = "app-商品分组")
public class SpuTagController {

    @Autowired
    private SpuTagService spuTagService;

    @GetMapping("/list")
    @Operation(summary = "获取商品分组列表" , description = "获取商品分组列表")
    @Parameters(value = {
            @Parameter(name = "shopId", description = "店铺id" )
    })
    public ServerResponseEntity<List<SpuTagVO>> list(@RequestParam(value = "shopId", defaultValue = "0") Long shopId) {
        List<SpuTagVO> spuTagList = spuTagService.listByShopId(shopId);
        return ServerResponseEntity.success(spuTagList);
    }
}
